﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ASCalpuff.FileLayers
{
    /// <summary>
    /// 点源参数
    /// 好像现在缺少子组C 建筑物参数类
    /// </summary>
    public class PG13:Group
    {

        // Fields
        //点源参数
        // private PointParameters[] m_ArrPointParameters;


        /// <summary>
        /// 具有恒定参数或可变排放速率换算因子的点源的个数
        /// </summary>
        //private int m_NPT1 = 2;
        private int m_NPT1 = 0;
        public int NPT1
        {
            get { return m_NPT1; }
            set { m_NPT1 = value; }
        }

        //


        /// <summary>
        /// 排放速率单位选项
        ///   1 =        g/s
        ///  2 =       kg/hr
        ///   3 =       lb/hr
        ///  4 =     tons/yr
        ///  5 =     Odour Unit * m**3/s  (vol. flux of odour compound)
        ///    6 =     Odour Unit * m**3/min
        /// 7 =     metric tons/yr
        /// </summary>
        private int m_IPTU = 1;

        public int IPTU
        {
            get { return m_IPTU; }
            set { m_IPTU = value; }
        }

        /// <summary>
        /// 13B输入可变排放速率排放污染源的数目
        /// </summary>
        private int m_NSPT1 = 0;

        public int NSPT1
        {
            get { return m_NSPT1; }
            set { m_NSPT1 = value; }
        }



        /// <summary>
        /// 3B输入可变排放速率文件排放污染源的数目（如果NPT2>2,就必须提供点源变化排放文件PTEMARB.DAT）
        /// </summary>
        private int m_NPT2 = 0;

        public int NPT2
        {
            get { return m_NPT2; }
            set { m_NPT2 = value; }
        }

        /// <summary>
        /// 不变速率的排放源参数
        /// </summary>
        List<PointSInfo> m_PsInfo = new List<PointSInfo>();

        public List<PointSInfo> PsInfo
        {
            get { return m_PsInfo; }
            // set { m_PsInfo = value; }
        }



       

        public override string WriteToGroup()
        {
            string Subgroup = "", TempStr;

            TempStr = StrWriter.GetCLine();
            TempStr += "INPUT GROUPS: 13a, 13b, 13c, 13d -- Point source parameters" + "\r\n";
            Subgroup += TempStr;

            TempStr = StrWriter.GetCLine();
            Subgroup += TempStr;

            TempStr = "! NPT1 = " + NPT1.ToString() + " !" + "\r\n";
            Subgroup += TempStr;

            TempStr = "! IPTU = " + IPTU.ToString() + " !" + "\r\n";
            Subgroup += TempStr;

            TempStr = "! NSPT1 = " + NSPT1.ToString() + " !" + "\r\n";
            Subgroup += TempStr;

            TempStr = "! NPT2 = " + NPT2.ToString() + " !" + "\r\n";
            Subgroup += TempStr;

            Subgroup += "!END!" + "\r\n";

            //Subgroup (13b)       POINT SOURCE: CONSTANT DATA



            //进行排序
            List<string> arry = Sort.GetPollutantRightOrder();
            List<PointSInfo> arryPointSInfo = new List<PointSInfo>();
            arryPointSInfo.Clear();
            foreach (PointSInfo P in PsInfo)
            {
                arryPointSInfo.Add((PointSInfo)P.Clone());
            }
            List<PolluteRatesVar> arryPolluteRatesVar = new List<PolluteRatesVar>();

            for (int i = 0; i < PsInfo.Count; i++)
            {
                arryPolluteRatesVar.Clear();
                foreach (string a in arry)
                {
                    for (int j = 0; j < PsInfo[i].X.ArryPolluteRatesVar.Count; j++)
                    {

                        if (a == PsInfo[i].X.ArryPolluteRatesVar[j].PolluteName)
                        {
                            arryPolluteRatesVar.Add(PsInfo[i].X.ArryPolluteRatesVar[j]);
                            break;
                        }
                    }
                }
                for (int k = 0; k < arryPointSInfo[i].X.ArryPolluteRatesVar.Count; k++)
                {
                    arryPointSInfo[i].X.ArryPolluteRatesVar[k] = (PolluteRatesVar)arryPolluteRatesVar[k].Clone();
                }

            }

            //---------------------------------------



            if (arryPointSInfo.Count > 0)
            {
                for (int i = 0; i < arryPointSInfo.Count; i++)
                {

                    //if (arryPointSInfo[i].SourceVarHouEmiRatBase.IsSourceHour == false)
                    //{

                    //    TempStr = "! SRCNAM =  " + arryPointSInfo[i].SRCNAM + "  !" + "\r\n";
                    //    TempStr += " ! X     " + " = " + Math.Round(arryPointSInfo[i].X.XUTM, 5).ToString() + ",  " + Math.Round(arryPointSInfo[i].X.YUTM, 5).ToString() + ",   " + Math.Round(arryPointSInfo[i].X.HSTAK, 3).ToString() + ",   " + Math.Round(arryPointSInfo[i].X.SELEV, 3).ToString() + ",   " + Math.Round(arryPointSInfo[i].X.DLAM, 3).ToString() + ",   " + Math.Round(arryPointSInfo[i].X.EXITW, 3).ToString() + ",   " + Math.Round(arryPointSInfo[i].X.EXITT, 3).ToString() + ",   " + Math.Round(arryPointSInfo[i].X.BDOWN, 3).ToString();
                    //    for (int j = 0; j < arryPointSInfo[i].X.ArryPolluteRatesVar.Count; j++)
                    //    {

                    //        if (arryPointSInfo[i].X.Unit == "g/s")
                    //        {
                    //            //每隔3个数据就换行
                    //            if ((j) % 3 == 0)
                    //            {

                    //                TempStr += ",  " + "\r\n" + arryPointSInfo[i].X.ArryPolluteRatesVar[j].Rate.ToString("E5");

                    //            }
                    //            else
                    //            {
                    //                TempStr += ",  " + arryPointSInfo[i].X.ArryPolluteRatesVar[j].Rate.ToString("E5");
                    //            }
                    //        }
                    //        else
                    //        {

                    //            if ((j) % 3 == 0)
                    //            {
                    //                TempStr += ",  " + "\r\n" + (arryPointSInfo[i].X.ArryPolluteRatesVar[j].Rate * 1000 / 3600).ToString("E5");
                    //            }
                    //            else
                    //            {
                    //                TempStr += ",  " + (arryPointSInfo[i].X.ArryPolluteRatesVar[j].Rate * 1000 / 3600).ToString("E5");
                    //            }
                    //        }
                    //        //TempStr += ",  " + PsInfo[i].X.EMS[j];

                    //    }
                    //    TempStr += " !" + "\r\n";



                    //    //if (PsInfo[i].SIGMAYI.Count > 0 && PsInfo[i].SIGMAZI.Count > 0)
                    //    {
                    //        TempStr += "! SIGYZI = ";
                    //        TempStr += Math.Round(arryPointSInfo[i].SIGMAYI, 3).ToString() + "," + Math.Round(arryPointSInfo[i].SIGMAZI, 3).ToString() + "  !" + "\r\n";
                    //    }


                    //    TempStr += "! ZPLTFM =  " + Math.Round(arryPointSInfo[i].ZPLTFM, 3).ToString() + "  !" + "\r\n";
                    //    TempStr += "! FMFAC =  " + Math.Round(arryPointSInfo[i].FMFAC, 3).ToString() + "  !" + "\r\n" + "! END !" + "\r\n";
                    //    Subgroup += TempStr;
                    //}





                }

            }

            //Subgroup (13c)  BUILDING DIMENSION DATA FOR SOURCES SUBJECT TO DOWNWASH

            //if (arryPointSInfo.Count > 0 && CProj.DefaultProj.CalPuff.BuildingWashInp.ArryBuilding.Count > 0)
            //{
            //    for (int i = 0; i < arryPointSInfo.Count; i++)
            //    {
            //        if (Convert.ToInt32(arryPointSInfo[i].X.BDOWN) == 1 && arryPointSInfo[i].SourceVarHouEmiRatBase.IsSourceHour == false)
            //        {
            //            TempStr = "! SRCNAM =  " + PsInfo[i].SRCNAM + "  !" + "\r\n";
            //            TempStr += "! HEIGHT = ";
            //            for (int j = 0; j < arryPointSInfo[i].PsInfo2.HEIGHT.Count; j++)
            //            {

            //                if (j == arryPointSInfo[i].PsInfo2.HEIGHT.Count - 1)
            //                {
            //                    TempStr += Math.Round(arryPointSInfo[i].PsInfo2.HEIGHT[j], 3).ToString() + "!" + "\r\n";
            //                }
            //                else
            //                {
            //                    if ((j + 1) % 6 == 0)
            //                    {
            //                        TempStr += Math.Round(arryPointSInfo[i].PsInfo2.HEIGHT[j], 3).ToString() + ", " + "\r\n";
            //                    }
            //                    else
            //                    {
            //                        TempStr += Math.Round(arryPointSInfo[i].PsInfo2.HEIGHT[j], 3).ToString() + ", ";
            //                    }
            //                }

            //            }
            //            TempStr += "! WIDTH = ";
            //            for (int j = 0; j < arryPointSInfo[i].PsInfo2.WIDTH.Count; j++)
            //            {

            //                if (j == arryPointSInfo[i].PsInfo2.WIDTH.Count - 1)
            //                {
            //                    TempStr += Math.Round(arryPointSInfo[i].PsInfo2.WIDTH[j], 3).ToString() + "!" + "\r\n";
            //                }
            //                else
            //                {
            //                    if ((j + 1) % 6 == 0)
            //                    {
            //                        TempStr += Math.Round(arryPointSInfo[i].PsInfo2.WIDTH[j], 3).ToString() + ", " + "\r\n";
            //                    }
            //                    else
            //                    {
            //                        TempStr += Math.Round(arryPointSInfo[i].PsInfo2.WIDTH[j], 3).ToString() + ", ";
            //                    }
            //                }

            //            }
            //            TempStr += "! LENGTH = ";
            //            for (int j = 0; j < arryPointSInfo[i].PsInfo2.LENGTH.Count; j++)
            //            {

            //                if (j == arryPointSInfo[i].PsInfo2.LENGTH.Count - 1)
            //                {
            //                    TempStr += Math.Round(arryPointSInfo[i].PsInfo2.LENGTH[j], 3).ToString() + "!" + "\r\n";
            //                }
            //                else
            //                {
            //                    if ((j + 1) % 6 == 0)
            //                    {
            //                        TempStr += Math.Round(arryPointSInfo[i].PsInfo2.LENGTH[j], 3).ToString() + ", " + "\r\n";
            //                    }
            //                    else
            //                    {
            //                        TempStr += Math.Round(arryPointSInfo[i].PsInfo2.LENGTH[j], 3).ToString() + ", ";
            //                    }
            //                }

            //            }
            //            TempStr += "! XBADJ = ";
            //            for (int j = 0; j < arryPointSInfo[i].PsInfo2.XBADJ.Count; j++)
            //            {

            //                if (j == arryPointSInfo[i].PsInfo2.XBADJ.Count - 1)
            //                {
            //                    TempStr += Math.Round(arryPointSInfo[i].PsInfo2.XBADJ[j], 3).ToString() + "!" + "\r\n";
            //                }
            //                else
            //                {
            //                    if ((j + 1) % 6 == 0)
            //                    {
            //                        TempStr += Math.Round(arryPointSInfo[i].PsInfo2.XBADJ[j], 3).ToString() + ", " + "\r\n";
            //                    }
            //                    else
            //                    {
            //                        TempStr += Math.Round(arryPointSInfo[i].PsInfo2.XBADJ[j], 3).ToString() + ", ";
            //                    }
            //                }

            //            }
            //            TempStr += "! YBADJ = ";
            //            for (int j = 0; j < arryPointSInfo[i].PsInfo2.YBADJ.Count; j++)
            //            {

            //                if (j == arryPointSInfo[i].PsInfo2.YBADJ.Count - 1)
            //                {
            //                    TempStr += Math.Round(arryPointSInfo[i].PsInfo2.YBADJ[j], 3).ToString() + "!" + "\r\n";
            //                }
            //                else
            //                {
            //                    if ((j + 1) % 6 == 0)
            //                    {
            //                        TempStr += Math.Round(arryPointSInfo[i].PsInfo2.YBADJ[j], 3).ToString() + ", " + "\r\n";
            //                    }
            //                    else
            //                    {
            //                        TempStr += Math.Round(arryPointSInfo[i].PsInfo2.YBADJ[j], 3).ToString() + ", ";
            //                    }
            //                }

            //            }

            //            Subgroup += TempStr + "! END !" + "\r\n";

            //        }

            //    }

            //}




            //Subgroup (13d)  POINT SOURCE: VARIABLE EMISSIONS DATA

            //这里暂时被注销


            //string F = "";
            //if (arryPointSInfo.Count > 0)
            //{
            //    for (int i = 0; i < arryPointSInfo.Count; i++)
            //    {

            //        if (arryPointSInfo[i].SourceVarHouEmiRatBase.IsSourceHour == false)
            //        {
            //            string D = "";
            //            for (int j = 0; j < arryPointSInfo[i].X.ArryPolluteRatesVar.Count; j++)
            //            {
            //                if (arryPointSInfo[i].X.ArryPolluteRatesVar[j].IVARY != 0)
            //                {
            //                    string A = "! SRCNAM = " + arryPointSInfo[i].SRCNAM + " !" + "\r\n";
            //                    string B = "! IVARY  =  " + arryPointSInfo[i].X.ArryPolluteRatesVar[j].IVARY + "  !" + "\r\n";
            //                    string C = "";
            //                    for (int k = 0; k < arryPointSInfo[i].X.ArryPolluteRatesVar[j].ArryCoefficient.Count; k++)
            //                    {

            //                        if (k != arryPointSInfo[i].X.ArryPolluteRatesVar[j].ArryCoefficient.Count - 1)
            //                        {
            //                            C = C + arryPointSInfo[i].X.ArryPolluteRatesVar[j].ArryCoefficient[k].ToString() + ",";
            //                        }
            //                        else
            //                        {
            //                            C = C + arryPointSInfo[i].X.ArryPolluteRatesVar[j].ArryCoefficient[k].ToString() + "      !";
            //                        }
            //                        if ((k + 1) % 6 == 0)
            //                        {
            //                            C = C + "\r\n";
            //                        }
            //                    }
            //                    C = "! " + arryPointSInfo[i].X.ArryPolluteRatesVar[j].PolluteName + "          = " + C + "!END!" + "\r\n";
            //                    D = D + A + B + C;
            //                }
            //            }
            //            F = F + D;

            //        }


            //    }
            //    Subgroup = Subgroup + F;
            //}


            return Subgroup;
        }

        public override void ReadFromGroup(Dictionary<string, string> dic)
        {
            foreach (KeyValuePair<string, string> m_dic in dic)
            {
                if (m_dic.Key == "NPT1")
                {
                    this.NPT1 = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "IPTU")
                {
                    this.IPTU = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "NSPT1")
                {
                    this.NSPT1 = Convert.ToInt32(m_dic.Value);
                }
                if (m_dic.Key == "NPT2")
                {
                    this.NPT2 = Convert.ToInt32(m_dic.Value);
                }

                PointSInfo ps = new PointSInfo();
                List<double> lst = new List<double>();
                int a;
                if (m_dic.Key == "SRCNAM")
                {
                    ps.SRCNAM = m_dic.Value;
                }
                if (m_dic.Key == "X")
                {
                    lst = StrWriter.ReturnDouList(m_dic.Value);
                    ps.X.XUTM = lst[0];
                    ps.X.YUTM = lst[1];
                    ps.X.HSTAK = lst[2];

                    ps.X.SELEV = lst[3];
                    ps.X.DLAM = lst[4];
                    ps.X.EXITW = lst[5];

                    ps.X.EXITT = lst[6];
                    ps.X.BDOWN = lst[7];
                    ps.X.ArryPolluteRatesVar.Clear();
                    for (int i = 8; i < lst.Count; i++)
                    {
                        PolluteRatesVar mPolluteRatesVar = new PolluteRatesVar();
                        mPolluteRatesVar.Rate = lst[i];
                        ps.X.ArryPolluteRatesVar.Add(mPolluteRatesVar);
                    }

                }
                if (m_dic.Key == "ZPLTFM")
                {
                    ps.ZPLTFM = Convert.ToDouble(m_dic.Value);
                }
                if (m_dic.Key == "FMFAC")
                {
                    ps.FMFAC = Convert.ToDouble(m_dic.Value);
                }
                PsInfo.Add(ps);


            }

        }



    }




    /// <summary>
    /// 点源参数
    /// </summary>
    [Serializable]
    public class PointSInfo : ICloneable
    {
        /// <summary>
        /// 污染源名称标志
        /// </summary>
        string m_SRCNAM;

        public string SRCNAM
        {
            get { return m_SRCNAM; }
            set { m_SRCNAM = value; }
        }

        private int m_Sid = 0;
        /// <summary>
        ///　污染源编号记录器，只增加，不减少以避免重复，且唯一.
        /// </summary>
        public int Sid
        {
            get { return m_Sid; }
            set { m_Sid = value; }
        }


        private string m_Name = "L";
        /// <summary>
        /// 污染源名称，非Inp文件
        /// </summary>
        public string Name
        {
            get { return m_Name; }
            set { m_Name = value; }
        }

        //细节信息
        PointXInfo m_X = new PointXInfo();

        public PointXInfo X
        {
            get { return m_X; }
            set { m_X = value; }
        }

        private bool m_IsSigma = false;// 是否Sigma,默认不使用
        /// <summary>
        /// 是否Sigma,默认不使用
        /// </summary>
        public bool IsSigma
        {
            get { return m_IsSigma; }
            set { m_IsSigma = value; }
        }

        //is the platform height (m) for sources influenced by an isolated
        //        structure that has a significant open area between the surface
        //        and the bulk of the structure, such as an offshore oil platform.
        //        The Base Elevation is that of the surface (ground or ocean),
        //        and the Stack Height is the release height above the Base (not
        //        above the platform).  Building heights entered in Subgroup 13c
        //        must be those of the buildings on the platform, measured from
        //        the platform deck.  ZPLTFM is used only with MBDW=1 (ISC
        //        downwash method) for sources with building downwash.
        //        (Default: 0.0)


        double m_ZPLTFM = 0.0;

        public double ZPLTFM
        {
            get { return m_ZPLTFM; }
            set { m_ZPLTFM = value; }
        }

        // is a vertical momentum flux factor (0. or 1.0) used to represent
        //the effect of rain-caps or other physical configurations that
        //reduce momentum rise associated with the actual exit velocity.
        //(Default: 1.0  -- full momentum used)

        double m_FMFAC = 0;

        public double FMFAC
        {
            get { return m_FMFAC; }
            set { m_FMFAC = value; }
        }



        //以下两个变量未可选变量，用于具有特征分部的点源
        /// <summary>
        /// 排放源初始sigma-y (m)
        /// </summary>
        //List<double> m_SIGMAYI = new List<double>();
        double m_SIGMAYI = 0.0;

        public double SIGMAYI
        {
            get { return m_SIGMAYI; }
            set { m_SIGMAYI = value; }
        }

        /// <summary>
        /// 排放源初始sigma-z (m)
        /// </summary>
        //List<double> m_SIGMAZI = new List<double>();
        double m_SIGMAZI = 0.0;

        public double SIGMAZI
        {
            get { return m_SIGMAZI; }
            set { m_SIGMAZI = value; }
        }

        /// <summary>
        /// 13 子组C 建筑物参数类
        /// </summary>
        PointSInfo2 m_PsInfo2 = new PointSInfo2();
        /// <summary>
        /// 存储建筑物下洗结果信息
        /// </summary>
        public PointSInfo2 PsInfo2
        {
            get { return m_PsInfo2; }
            set { m_PsInfo2 = value; }
        }



        ///// <summary>
        ///// 小时排放速率参数类
        ///// </summary>
        ///// <returns></returns>
        //SourceVarHouEmiRatBase m_SourceVarHouEmiRatBase = new SourceVarHouEmiRatBase();

        //public SourceVarHouEmiRatBase SourceVarHouEmiRatBase
        //{
        //    get { return m_SourceVarHouEmiRatBase; }
        //    set { m_SourceVarHouEmiRatBase = value; }
        //}


        public object Clone()
        {
            PointSInfo obj = new PointSInfo();
            obj = (PointSInfo)this.MemberwiseClone();

            //List<double> mSIGMAYI = new List<double>();
            //for (int i = 0; i < this.m_SIGMAYI.Count; i++)
            //{
            //    mSIGMAYI.Add(this.m_SIGMAYI[i]);
            //}
            //obj.m_SIGMAYI = mSIGMAYI;

            //List<double> mSIGMAZI = new List<double>();
            //for (int i = 0; i < this.m_SIGMAZI.Count; i++)
            //{
            //    mSIGMAZI.Add(this.m_SIGMAZI[i]);
            //}
            //obj.m_SIGMAZI = mSIGMAZI;


            PointXInfo mPointXInfo = new PointXInfo();
            mPointXInfo = (PointXInfo)this.X.Clone();//调用 PointXInfo 的克隆方法  把类中保存的数据 传递给新的实例 mPointXInfo
            obj.X = mPointXInfo;

            PointSInfo2 mPointSinfo2 = new PointSInfo2();
            mPointSinfo2 = (PointSInfo2)this.PsInfo2.Clone();//调用 PointXInfo2 的克隆方法
            obj.PsInfo2 = mPointSinfo2;

            //SourceVarHouEmiRatBase mSourceVarHouEmiRatBase = new SourceVarHouEmiRatBase();
            //mSourceVarHouEmiRatBase = (SourceVarHouEmiRatBase)this.SourceVarHouEmiRatBase.Clone();
            //obj.SourceVarHouEmiRatBase = mSourceVarHouEmiRatBase;


            return obj;

        }




    }
    /// <summary>
    /// 点源排放参数
    /// </summary>

    [Serializable]
    public class PointXInfo : ICloneable
    {

        public PointXInfo()
        {

        }
        /// <summary>
        /// 点源X坐标
        /// </summary>
        double m_XUTM = 0;

        public double XUTM
        {
            get { return m_XUTM; }
            set { m_XUTM = value; }
        }
        /// <summary>
        /// 点源Y坐标
        /// </summary>
        double m_YUTM = 0;

        public double YUTM
        {
            get { return m_YUTM; }
            set { m_YUTM = value; }
        }


        /// <summary>
        /// 烟囱的高度，m
        /// </summary>
        double m_HSTAK = 0;

        public double HSTAK
        {
            get { return m_HSTAK; }
            set { m_HSTAK = value; }
        }


        /// <summary>
        /// 烟囱基底海拔高度
        /// </summary>
        double m_SELEV = 0;

        public double SELEV
        {
            get { return m_SELEV; }
            set { m_SELEV = value; }
        }


        /// <summary>
        /// 烟囱的直径
        /// </summary>
        double m_DLAM = 0;

        public double DLAM
        {
            get { return m_DLAM; }
            set { m_DLAM = value; }
        }


        /// <summary>
        /// 烟气速度 m/s
        /// </summary>
        double m_EXITW = 0;

        public double EXITW
        {
            get { return m_EXITW; }
            set { m_EXITW = value; }
        }


        /// <summary>
        /// 烟气温度 k
        /// </summary>
        double m_EXITT = 0;

        public double EXITT
        {
            get { return m_EXITT; }
            set { m_EXITT = value; }
        }


        /// <summary>
        /// 是否考虑建筑物下洗
        /// =0，不考虑;1=考虑
        /// 必须写成real数，不能写成普通整形变量
        /// </summary>
        double m_BDOWN = 0;

        public double BDOWN
        {
            get { return m_BDOWN; }
            set { m_BDOWN = value; }
        }


        private List<PolluteRatesVar> m_arryPolluteRatesVar = new List<PolluteRatesVar>();
        /// <summary>
        /// 污染物速率相关的一此参数
        /// </summary>
        public List<PolluteRatesVar> ArryPolluteRatesVar
        {
            get { return m_arryPolluteRatesVar; }
            set { m_arryPolluteRatesVar = value; }
        }


        private string m_Unit = "g/s";//单位
        /// <summary>
        /// 单位
        /// </summary>
        public string Unit
        {
            get { return m_Unit; }
            set { m_Unit = value; }
        }

        public object Clone()
        {
            PointXInfo obj = new PointXInfo();
            obj = (PointXInfo)this.MemberwiseClone();
            List<PolluteRatesVar> arryPollute = new List<PolluteRatesVar>();
            for (int i = 0; i < this.ArryPolluteRatesVar.Count; i++)
            {
                arryPollute.Add((PolluteRatesVar)this.ArryPolluteRatesVar[i].Clone());
            }
            obj.ArryPolluteRatesVar = arryPollute;
            return obj;
        }
    }




    [Serializable]
    public class PointSInfo2 : ICloneable
    {
        public PointSInfo2()
        {
            for (int i = 0; i < 36; i++)
            {
                HEIGHT.Add(0);//集合初始化
                WIDTH.Add(0);
                LENGTH.Add(0);
                XBADJ.Add(0);
                YBADJ.Add(0);

            }
        }
        /// <summary>
        /// 污染源名称
        /// </summary>
        string m_SRCNAM;

        public string SRCNAM
        {
            get { return m_SRCNAM; }
            set { m_SRCNAM = value; }
        }

        /// <summary>
        /// 建筑物高度
        /// </summary>
        List<double> m_HEIGHT = new List<double>();

        public List<double> HEIGHT
        {
            get { return m_HEIGHT; }
            set { m_HEIGHT = value; }
        }

        /// <summary>
        /// 建筑物宽度
        /// </summary>
        List<double> m_WIDTH = new List<double>();

        public List<double> WIDTH
        {
            get { return m_WIDTH; }
            set { m_WIDTH = value; }
        }

        /// <summary>
        /// 建筑物长度
        /// </summary>
        List<double> m_LENGTH = new List<double>();

        public List<double> LENGTH
        {
            get { return m_LENGTH; }
            set { m_LENGTH = value; }
        }
        /// <summary>
        /// XBADJ
        /// </summary>
        List<double> m_XBADJ = new List<double>();

        public List<double> XBADJ
        {
            get { return m_XBADJ; }
            set { m_XBADJ = value; }
        }
        /// <summary>
        /// YBADJ
        /// </summary>
        List<double> m_YBADJ = new List<double>();

        public List<double> YBADJ
        {
            get { return m_YBADJ; }
            set { m_YBADJ = value; }
        }

        public object Clone()
        {
            PointSInfo2 obj = new PointSInfo2();
            obj = (PointSInfo2)this.MemberwiseClone();

            List<double> mHEIGHT = new List<double>();
            for (int i = 0; i < this.HEIGHT.Count; i++)
            {
                mHEIGHT.Add(this.HEIGHT[i]);
            }
            obj.m_HEIGHT = mHEIGHT;
            List<double> mWIDTH = new List<double>();
            for (int i = 0; i < this.WIDTH.Count; i++)
            {
                mWIDTH.Add(this.WIDTH[i]);
            }
            obj.WIDTH = mWIDTH;
            List<double> mLENGTH = new List<double>();
            for (int i = 0; i < this.LENGTH.Count; i++)
            {
                mLENGTH.Add(this.LENGTH[i]);
            }
            obj.LENGTH = mLENGTH;
            List<double> mXBADJ = new List<double>();
            for (int i = 0; i < this.XBADJ.Count; i++)
            {
                mXBADJ.Add(this.XBADJ[i]);
            }
            obj.XBADJ = mXBADJ;
            List<double> mYBADJ = new List<double>();
            for (int i = 0; i < this.YBADJ.Count; i++)
            {
                mYBADJ.Add(this.YBADJ[i]);
            }
            obj.YBADJ = mYBADJ;



            return obj;

        }


    }





}
